<!--
Notice:
  I feel so dirty doing this, but its the only way to make it cross browser.
-->
<html>
<head>
  <style>
    body {
      padding: 0;
      margin: 0;
      overflow: hidden;
      font-family: helvetica, verdana, sans-serif;
    }

    #GB_frame {
      visibility: hidden;
      width: 100%;
      height: 100%;
    }

    #loading {
      padding-top: 10px;
      position: absolute;
      width: 100%;
      top: 0;
      font-size: 25px;
      text-align: center;
      color: #616161;
    }
  </style>
</head>
<body>

<div id="loading">
  <img src="indicator.gif" style="padding-bottom: 10px"><br />
  LOADING
</div>

<script>
var GB = parent.GB_CURRENT;

var gb_type = GB.type;
var gb_url = GB.url;

//Start loading in the iframe
if(gb_type == "page") {
  document.write('<iframe id="GB_frame" src="' + gb_url + '" frameborder="0"></iframe>');
}
else {
  var img_holder;
  img_holder = new Image();
  img_holder.src = gb_url;
  document.write('<img id="GB_frame" src="' + gb_url + '">');
}
</script>

</body>
<script>
var old_onload = window.onload;
window.onload = function (e) {
  var frame = document.getElementById('GB_frame');
  var loading = document.getElementById('loading');

  loading.style.display = "none";
  frame.style.visibility = "visible";

  if(gb_type == "image") {
    GB.setDimension(img_holder.width, img_holder.height);
    GB.setTopNLeft();
    //Safari render bug fix
    GB.overlay.innerHTML = GB.overlay.innerHTML + "&nbsp;";
    GB.setWidthNHeight();
  }
  if(old_onload)
    old_onload(e);
};
</script>
</html>
